// JavaScript Document
$.fn.idTabs=function(params){
	var options={
            clickedClass:"selected",
			attrName:"toid",
			hideFun:null,
			showFun:null
            };
    if(options!=null){
        $.extend(options,params);
    }
	return this.each(function(){
		var context=this;
		$("*[" + options.attrName + "]",context).click(function(){
			var pre=$("*[" + options.attrName + "]." + options.clickedClass,context);
			var hideDiv=$("#" + $(pre).attr(options.attrName));
			if(typeof(options.hideFun)=="function") options.hideFun(hideDiv)
			else $(hideDiv).hide();
			$(pre).removeClass(options.clickedClass);
			$(this).addClass(options.clickedClass);
			var showDiv=$("#" + $(this).attr(options.attrName))
			if(typeof(options.showFun)=="function") showFun(showDiv);
			else $(showDiv).animate({opacity:"show"},500);
		})
		$(context).data("unbind",function(){
			$("*[" + options.attrName + "]",context).unbind("click");
		})
	})	
}
$.fn.unidTabs=function(){
	return this.each(function(){
		var fun=$(this).data("unbind");
		if(typeof(fun)=="function") fun();	
	})	
}
//$(document).ready(function(){$("#idTabs").idTabs();})